package com.zhanglei.algorithm;

import com.zhanglei.method.Student;

/**
 * @author caesar
 * @date 2025/7/7
 * @apiNote
 */
public class StudentMax {
    public static void main(String[] args) {
        Student[] students = new Student[3];
        //学生报到
        students[0] = new Student("张三", 89);
        students[1] = new Student("李四", 84);
        students[2] = new Student("王五", 90);

        Student max = students[0]; //max现在代表一个学生对象
        for (int i = 1; i < students.length; i++) {
            if (max.getScore() < students[i].getScore()) {
                max = students[i];
            }
        }
        System.out.println("成绩最高的学生:" + max.display());
    }
}
